package masterjava.common.shared.logging;

import org.jetbrains.annotations.Nullable;

/**
 * User: Grigory Kislin
 * Date: 24/06/11
 */
public abstract class AbstractLogger {

    public abstract void treatThrowable(String msg, Throwable e) throws Error, RuntimeException;
    public abstract void log(LoggingLevel logLevel, CharSequence msg, @Nullable Throwable t);

    public void debug(CharSequence msg) {
        log(LoggingLevel.DEBUG, msg, null);
    }

    public void info(CharSequence msg) {
        log(LoggingLevel.INFO, msg, null);
    }

    public void warn(CharSequence msg) {
        log(LoggingLevel.WARN, msg, null);
    }

    public void warn(CharSequence msg, Throwable t) {
        log(LoggingLevel.WARN, msg, t);
    }

    public void error(String msg) {
        log(LoggingLevel.ERROR, msg, null);
    }

    public void error(CharSequence msg, Throwable t) {
        log(LoggingLevel.ERROR, msg, t);
    }
}
